#ifndef _UTILS_FONT_H_
# define _UTILS_FONT_H_

# include "config.h"
# include <SDL/SDL.h>
# include <SDL/SDL_ttf.h>
# include <string>

NS_BEGIN(SDL)
	NS_BEGIN(UTILS)

	typedef SDL_Surface* (*tRenderSolidBlended)(TTF_Font*, Uint16 const*, SDL_Color);
	typedef SDL_Surface* (*tRenderShaded)(TTF_Font*,
						  Uint16 const*, SDL_Color, SDL_Color);

	class Font
	{
	public:
		static tRenderSolidBlended const RenderSolid;
		static tRenderSolidBlended const RenderBlended;
		static tRenderShaded const RenderShaded;

	private:
		std::string m_path;
		TTF_Font* m_font;

	public:
		Font(std::string const& _path, int _size, int _style = TTF_STYLE_NORMAL);
	private:
		Font(Font const&);
	public:
		~Font();

	private:
		Font& operator=(Font const&);

	public:
		int CalculWidth(std::string const& _text) const;

		static std::wstring StringToWString(std::string const& _s);
		static std::string WStringToString(std::wstring const& _s);

		std::string const& GetPath() const;
		TTF_Font* GetFont() const;
		int GetSize() const;
		int GetStyle() const;

	public:
		__declspec(property(get=GetPath)) std::string path;
		__declspec(property(get=GetFont)) TTF_Font* font;
		__declspec(property(get=GetSize)) int size;
		__declspec(property(get=GetStyle)) int style;
	};

	NS_END(UTILS)
NS_END(SDL)

#endif // _UTILS_FONT_H_
